<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>

    </style>
</head>
<body>

<div id="app">

    <input type="text" v-model="num1">
    <select v-model="opt">
        <option value="+">+</option>
        <option value="-">-</option>
        <option value="*">*</option>
        <option value="/">/</option>
    </select>
    <input type="text" v-model="num2">
    <input type="button" value="=" @click="calculate">
    <input type="text" v-model="result">
</div>
<script src="lib/vue.js"></script>
<script>
    var vm = new Vue({
        el: '#app',
        data: {
            num1: 0,
            num2: 0,
            opt: '+',
            result: 0
        },
        methods: {
            calculate(){
                var codeStr = 'parseInt(this.num1)' + this.opt + 'parseInt(this.num2)';
                this.result = eval(codeStr);
            }
        }
    })
</script>
</body>
</html>